package com.example.demo.registar;

import com.example.demo.config.EnableUserService;
import com.example.demo.service.impl.UserServiceImpl;
import org.springframework.context.annotation.ImportSelector;
import org.springframework.core.type.AnnotationMetadata;

import java.util.Map;

/**
 * @author: zhushl
 * @Date: 2021-05-14 09:58
 * @Description:
 */
public class UerServiceImportSelector implements ImportSelector {
    @Override
    public String[] selectImports(AnnotationMetadata importingClassMetadata) {
        Map<String,Object> map =  importingClassMetadata.getAnnotationAttributes(EnableUserService.class.getName(),true);
        for(Map.Entry entry : map.entrySet()){
            System.out.println("key is: " + entry.getKey() + " Value is : " +entry.getValue() );
        }
        return new String[]{UserServiceImpl.class.getName()};
    }
}
